package Server;

import java.net.Socket;

/** A starting point for network servers. */
public abstract class NetworkServer {
	Socket server;
	String serverName;

	/**
	 * Build a server on specified port. It will continue to accept connections,
	 * passing each to handleConnection until the server is killed (e.g.,
	 * Control-C in the startup window) or System.exit() from handleConnection
	 * of elsewhere in the Java code).
	 */
	public NetworkServer(Socket server, String serverName) {
		this.server = server;
		this.serverName = serverName;

	}

	/**
	 * @return the server name
	 */
	public Socket getServer() {
		return server;
	}

	/**
	 * @param server name of the connection 
	 * the server to set
	 */
	public void setServer(Socket server) {
		this.server = server;
	}

	@Override
	public String toString() {
		return "NetworkServer [server=" + server + ", serverName=" + serverName
				+ "]";
	}

}
